﻿/// <reference path="vswd-ext_2.0.2.js" />
var queryWin;
var loginMethod;
var sSysCode;
var sSysName;
function OpenQuery(divConditionID, height, width, queryEvent, loginMethod, sSysCode, sSysName) {
    this.loginMethod = loginMethod;
    this.sSysCode = sSysCode;
    this.sSysName = sSysName;
    Ext.get(divConditionID).show();
    if (!queryWin) {
        queryWin = new Ext.Window({
            id: "Window1",
            title: sSysName + "授权窗口",
            height: height,
            width: width,
            layout: 'fit',
            autoShow: true,
            contentEl: divConditionID,
            collapsible: true,
            renderTo: "aspnetForm",
            closeAction: 'hide',
            buttons: [
                    {
                        text: '授权', handler: function () {
                            if (queryEvent)
                                queryEvent(loginMethod, sSysCode, sSysName);
                        }
                    },
                    {
                        text: '关闭',
                        handler: function () {
                            queryWin.hide();
                        }
                    }]
        });
    }
    else {
        queryWin.setTitle(sSysName + "授权窗口");
    }
    queryWin.show();
    queryWin.tools.toggle.hide();
    //    queryWin.setPosition(200, 200);
    return false;
}